﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using famails.iface;
using famails.dao;
using famails.dto;

namespace famails.bus
{
    /// <summary>
    /// Summary description for RoleListBUS
    /// </summary>
    public class RoleListBUS : IRoleList
    {
        RoleListDAO rlDao = null;
        public RoleListBUS()
        {
            rlDao = new RoleListDAO();
        }

        #region IRoleList Members

        public void tblRoleList_insert(RoleListDTO dt)
        {
            rlDao.tblRoleList_insert(dt);
        }

        public void tblRoleList_Delete(int roleId)
        {
            rlDao.tblRoleList_Delete(roleId);
        }

        public DataTable GetAll()
        {
            return rlDao.GetAll();
        }

        public DataTable GetByRoleId(int roleId)
        {
            return rlDao.GetByRoleId(roleId);
        }

        public DataTable GetRoleByDepartmentId(int departmentId)
        {
            return rlDao.GetRoleByDepartmentId(departmentId);
        }
        public DataTable GetMainMenuByDepartmentId(int departmentId)
        {
            return rlDao.GetMainMenuByDepartmentId(departmentId);
        }
        public DataTable GetSubMenuByDepartmentId(int departmentId)
        {
            return rlDao.GetSubMenuByDepartmentId(departmentId);
        }

        public DataTable GetSubMenuByParentId(int departmentId, object parentId)
        {
            return rlDao.GetSubMenuByParentId(departmentId, parentId);
        }
        public DataTable GetSubMenuByParentId(int userid, int accountid, object parentId)
        { return rlDao.GetSubMenuByParentId(userid, accountid, parentId); }
        #endregion



    }

}